package com.sxit.myproscenium.system.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.sxit.myproscenium.common.response.R;
import com.sxit.myproscenium.system.entity.Carousel;
import com.sxit.myproscenium.system.service.ICarouselService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 前端控制器
 *
 * @author wcn
 * @since 2022-04-10
 */
@RestController
@RequestMapping("/system/carousel")
public class CarouselController {

  @Autowired private ICarouselService carouselService;

  @GetMapping("/getCarousel")
  public R getCarousel() {
    QueryWrapper<Carousel> carouselQueryWrapper = new QueryWrapper<>();
    carouselQueryWrapper.eq("is_show", 1);
    List<Carousel> list = carouselService.list(carouselQueryWrapper);
    return R.ok().put("data", list);
  }


}
